#include "ParticleCarbon.h"

#include "ParticleContext.h"
#include "DescriptorParticle.h"

using namespace ParticleEngine; 

const DescriptorParticle ParticleCarbon::Descriptor
(
	"Carbon", 
	[](ParticleContext& NewContext) { return new ParticleCarbon(NewContext); }
); 

ParticleCarbon::ParticleCarbon(ParticleContext& NewContext) :
	ParticleBase(NewContext, &ParticleCarbon::Descriptor),
	Heat(0.5f)
{
	Adhesions = new PropertyAdhesions(0.15f);
	Adhesions->ParticleCast = this;
}
ParticleCarbon::~ParticleCarbon()
{
}

void ParticleCarbon::Sole()//einzelne aktualisierzung
{
	this->SoleStandard();

	this->Heat.Sole();
}
void ParticleCarbon::InteractionIndividual(ParticleBase*const Other, Vec<2, float>& Space, const float& DistanceSquared)
{
	this->InteractionKinetics(Other, Space, DistanceSquared);

	Heat.Interaction(Other->HasHeat());
}

ColorRGBA<unsigned char> ParticleCarbon::GetColor()
{
	return ColorRGBA<unsigned char> (64, 64,	96,	255);
}


void ParticleCarbon::SaveIndividual(std::ofstream& Strm)
{
	Heat.Save(Strm);
}
void ParticleCarbon::LoadIndividual(std::ifstream& Strm)
{
	Heat.Load(Strm);
}


